﻿
/*----------------------------------------------------------------//
// 文件名：MoSampleKept.cs
// 文件功能描述：实体 MoSampleKept.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoSampleKept
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoSampleKept
    /// </summary>
    public partial class MoSampleKept : ICloneable
    {
        #region 表SampleKept的字段
        private string samKepId;
        private string receiver;
        private string sender;
        private string senderTel;
        private string senderCorp;
        private string sampleName;
        private string model;
        private int qty;
        private string sampleStatus;
        private DateTime receiveDate;
        private string storeAddr;
        private string rem;
        #endregion

        #region 构造函数
        public MoSampleKept()
        {
            receiveDate = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoSampleKept(MoSampleKept item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoSampleKept(string samKepId, string receiver, string sender, string senderTel, string senderCorp, string sampleName, string model, int qty, string sampleStatus, DateTime receiveDate, string storeAddr, string rem)
        {
            this.samKepId = samKepId;
            this.receiver = receiver;
            this.sender = sender;
            this.senderTel = senderTel;
            this.senderCorp = senderCorp;
            this.sampleName = sampleName;
            this.model = model;
            this.qty = qty;
            this.sampleStatus = sampleStatus;
            this.receiveDate = receiveDate;
            this.storeAddr = storeAddr;
            this.rem = rem;
        }
        #endregion

        #region 表SampleKept的字段属性
        /// <summary>
        /// SAM_KEP_ID
        /// </summary>
        public string SamKepId
        {
            get { return samKepId; }
            set { samKepId = value; }
        }
        /// <summary>
        /// RECEIVER
        /// </summary>
        public string Receiver
        {
            get { return receiver; }
            set { receiver = value; }
        }
        /// <summary>
        /// SENDER
        /// </summary>
        public string Sender
        {
            get { return sender; }
            set { sender = value; }
        }
        /// <summary>
        /// SENDER_TEL
        /// </summary>
        public string SenderTel
        {
            get { return senderTel; }
            set { senderTel = value; }
        }
        /// <summary>
        /// SENDER_CORP
        /// </summary>
        public string SenderCorp
        {
            get { return senderCorp; }
            set { senderCorp = value; }
        }
        /// <summary>
        /// SAMPLE_NAME
        /// </summary>
        public string SampleName
        {
            get { return sampleName; }
            set { sampleName = value; }
        }
        /// <summary>
        /// MODEL
        /// </summary>
        public string Model
        {
            get { return model; }
            set { model = value; }
        }
        /// <summary>
        /// QTY
        /// </summary>
        public int Qty
        {
            get { return qty; }
            set { qty = value; }
        }
        /// <summary>
        /// SAMPLE_STATUS
        /// </summary>
        public string SampleStatus
        {
            get { return sampleStatus; }
            set { sampleStatus = value; }
        }
        /// <summary>
        /// RECEIVE_DATE
        /// </summary>
        public DateTime ReceiveDate
        {
            get { return receiveDate; }
            set { receiveDate = value; }
        }
        /// <summary>
        /// STORE_ADDR
        /// </summary>
        public string StoreAddr
        {
            get { return storeAddr; }
            set { storeAddr = value; }
        }
        /// <summary>
        /// REM
        /// </summary>
        public string Rem
        {
            get { return rem; }
            set { rem = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoSampleKept CopyTo(MoSampleKept item)
        {
            item.samKepId = this.samKepId;
            item.receiver = this.receiver;
            item.sender = this.sender;
            item.senderTel = this.senderTel;
            item.senderCorp = this.senderCorp;
            item.sampleName = this.sampleName;
            item.model = this.model;
            item.qty = this.qty;
            item.sampleStatus = this.sampleStatus;
            item.receiveDate = this.receiveDate;
            item.storeAddr = this.storeAddr;
            item.rem = this.rem;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoSampleKept mo = new MoSampleKept();
            mo.SamKepId = this.SamKepId;
            mo.Receiver = this.Receiver;
            mo.Sender = this.Sender;
            mo.SenderTel = this.SenderTel;
            mo.SenderCorp = this.SenderCorp;
            mo.SampleName = this.SampleName;
            mo.Model = this.Model;
            mo.Qty = this.Qty;
            mo.SampleStatus = this.SampleStatus;
            mo.ReceiveDate = this.ReceiveDate;
            mo.StoreAddr = this.StoreAddr;
            mo.Rem = this.Rem;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoSampleKept NewSampleKept = obj as MoSampleKept;
                if (NewSampleKept == null)
                {
                    return false;
                }
                else
                {
                    if (NewSampleKept.SamKepId == this.SamKepId && NewSampleKept.Receiver == this.Receiver && NewSampleKept.Sender == this.Sender && NewSampleKept.SenderTel == this.SenderTel && NewSampleKept.SenderCorp == this.SenderCorp && NewSampleKept.SampleName == this.SampleName && NewSampleKept.Model == this.Model && NewSampleKept.Qty == this.Qty && NewSampleKept.SampleStatus == this.SampleStatus && NewSampleKept.ReceiveDate == this.ReceiveDate && NewSampleKept.StoreAddr == this.StoreAddr && NewSampleKept.Rem == this.Rem)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "SamKepId={0}/Receiver={1}/Sender={2}/SenderTel={3}/SenderCorp={4}/SampleName={5}/Model={6}/Qty={7}/SampleStatus={8}/ReceiveDate={9}/StoreAddr={10}/Rem={11}", samKepId, receiver, sender, senderTel, senderCorp, sampleName, model, qty, sampleStatus, receiveDate, storeAddr, rem);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["Sam_Kep_ID"] != null && row["Sam_Kep_ID"] != DBNull.Value)
            {
                this.SamKepId = (string)row["Sam_Kep_ID"];
            }
            else
            {
                this.SamKepId = string.Empty;
            }
            if (row["Receiver"] != null && row["Receiver"] != DBNull.Value)
            {
                this.Receiver = (string)row["Receiver"];
            }
            else
            {
                this.Receiver = string.Empty;
            }
            if (row["Sender"] != null && row["Sender"] != DBNull.Value)
            {
                this.Sender = (string)row["Sender"];
            }
            else
            {
                this.Sender = string.Empty;
            }
            if (row["Sender_Tel"] != null && row["Sender_Tel"] != DBNull.Value)
            {
                this.SenderTel = (string)row["Sender_Tel"];
            }
            else
            {
                this.SenderTel = string.Empty;
            }
            if (row["Sender_Corp"] != null && row["Sender_Corp"] != DBNull.Value)
            {
                this.SenderCorp = (string)row["Sender_Corp"];
            }
            else
            {
                this.SenderCorp = string.Empty;
            }
            if (row["Sample_Name"] != null && row["Sample_Name"] != DBNull.Value)
            {
                this.SampleName = (string)row["Sample_Name"];
            }
            else
            {
                this.SampleName = string.Empty;
            }
            if (row["Model"] != null && row["Model"] != DBNull.Value)
            {
                this.Model = (string)row["Model"];
            }
            else
            {
                this.Model = string.Empty;
            }
            if (row["QTY"] != null && row["QTY"] != DBNull.Value)
            {
                this.Qty = (int)row["QTY"];
            }
            else
            {
                this.Qty = 0;
            }
            if (row["Sample_Status"] != null && row["Sample_Status"] != DBNull.Value)
            {
                this.SampleStatus = (string)row["Sample_Status"];
            }
            else
            {
                this.SampleStatus = string.Empty;
            }
            if (row["Receive_Date"] != null && row["Receive_Date"] != DBNull.Value)
            {
                this.ReceiveDate = (DateTime)row["Receive_Date"];
            }
            else
            {
                this.ReceiveDate = DateTime.MinValue;
            }
            if (row["Store_Addr"] != null && row["Store_Addr"] != DBNull.Value)
            {
                this.StoreAddr = (string)row["Store_Addr"];
            }
            else
            {
                this.StoreAddr = string.Empty;
            }
            if (row["Rem"] != null && row["Rem"] != DBNull.Value)
            {
                this.Rem = (string)row["Rem"];
            }
            else
            {
                this.Rem = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["Sam_Kep_ID"] = this.SamKepId;
            row["Receiver"] = this.Receiver;
            row["Sender"] = this.Sender;
            row["Sender_Tel"] = this.SenderTel;
            row["Sender_Corp"] = this.SenderCorp;
            row["Sample_Name"] = this.SampleName;
            row["Model"] = this.Model;
            row["QTY"] = this.Qty;
            row["Sample_Status"] = this.SampleStatus;
            row["Receive_Date"] = this.ReceiveDate;
            row["Store_Addr"] = this.StoreAddr;
            row["Rem"] = this.Rem;
        }
        #endregion
    }
}
#endregion
